Presenting GNO
By Marek Pawlowski and Brian Tao
Copyright (c) 1992 Apple Users' Group, Sydney
Republished from Applecations, a publication of the Apple Users' Group, Sydney, Australia.
Source: Internet
[Sub-editor's note: What follows is an edited transcript of a usergroup meeting in Toronto USA where the GNO multi-tasking environment was put through it's paces.]
What is GNO?
GNO is a multi-tasking shell environment for the Apple IIgs computer. It allows you to run up to 32 programs at the same time on the same computer.
Only one desktop application can run at one time, but multiple text applications can be running under a desktop application.
Initially the brain child of Tim Meekins and Jawaid Bazyar, already proven to be great programmers and contributors to the Apple IIgs community, it has expanded to include the efforts of programmers from Sweden, Germany, France, the USA, and Canada.
Shell Basics
While I'm doing this demonstration, I will be using several commands which deserve explaining, which I will do. But the most common ones are "cd" and "ls". "cd" changes the current directory and is similar to the "PREFIX" command in BASIC. "ls" lists the files in a directory and is similar to the "CAT" or "CATALOG" commands in BASIC.
GNO has a command line. The prompt is totally user definable, for example, I can set it to anything I wish:
>set prompt="Marek> "
Marek>
The variable "%C" holds the name of the current directory, so I can put that to use with:
Marek> set prompt="You are here: %C> "
You are here: /HARD.DISK/>
You are here: /HARD.DISK/> set prompt=">"
>
Other variables for time and date are also available.
The command line is where you will be doing most of your work, and there is so MUCH you can do here in GNO, it's unbelievable.
First there is the ability to "chain" commands. This means that one command is executed immediately after another finishes. This is accomplished by separating the commands with a semi-colon.
>cd /whatever ; ls
"Pretty useful" you say? It get's better..
You can "pipe", or "redirect" the output of a program, into a file, or another program. This is accomplished by separating the two commands with a vertical bar. This is truly useful. For example, the files in a large directory listing can be displayed a page at a time:
>ls | less
"less" is a page formatting tool which allows paging up and down.
Neat eh? But let's say you want to create a file with the contents of a ShrinkIt file? The tool "yankit" displays the contents of ShrinkIt archives and can unpack them. For example, the archive contents can be listed like so:
>yankit tv nlist34.shk
This contents list can be placed into another file:
>yankit tv nlist34.shk > archive.list
The "greater than" sign redirects the output to a file. I'll prove it to you: >cat archive.list
See? All there! This works with all commands that create output. You can list the contents of a directory and store the output to a file:
>ls > bar
>cat bar
Now, if you don't want to be bothered with all these cryptic and seemingly archaic command's I'm using, and want to use things like "Prefix" instead of "cd", or "catalog" instead of "ls", this is easily accomplished using the "alias" command:
>alias catalog ls
If I type "ls", it still works. But on top of that:
>catalog
does the same thing! Great stuff.
Typing "alias" on its own will give a list of all the currently defined alias'.
MultiTasking
Ok, we're ready for multi-tasking. I already feel the buzz of anticipation in the room, you guys can't wait for this can you?
Multi-tasking is accomplished by adding an "ampersand" right at the end of the command line. What I'll do here is show you a program and how it runs in the foreground, and then put it in the background to work, while I do other things on the GS.
So what I'll do is create a checksum of a file. This can be a lengthy task if the file is big enough. So I'll just do it
on a smaller file in the foreground so you can see what output is expected.
>sum whatever
Ok. Now. Let's say you have a larger file you want to do a checksum of, but you don't want to sit idling, waiting for the GS to complete this task, so you put it in to the background letting you do other stuff.
>sum largerfile &
[1] + running sum largerfile
Boom, I got my command line that fast. What's happening now, is that it's working on doing the checksum of the file in the background, and I can fool around in the foreground using "cd", "ls", etc. Now, I should be interrupted any time now by the final output of the task.
09120 11 largerfile
[1] + done sum largerfile
Cool. Now, you probably wouldn't want it to interrupt you like that, so you would just re-direct the output to a file, and it won't mess you up by spitting that stuff out on your screen.
>sum largerfile > checksum
Let me show you some more. Here we have an archived file, packed by shrinkit. The utility under GNO, to unarchive these files is called "yankit". I can show you the contents of this archive:
>yankit tv nlist34.shk
Now what I'll do is extract the files in the background.
>yankit x nlist34.shk &
Here's a command I will familiarize you with. It will give you the status of the process, and much more control over it.
>ps
Ok. We have some mumbo-jumbo-techie information here, but it's all useful. This is the process list. Here are all the programs that are being currently run on the shell, either in the foreground, or in the background.
Here's kern, our kernal, and gsh is the actual shell program. And here is our yankit process running in the background. The numbers here to the far left, are the process ID numbers of the process. The real use of them, is to identify the process by supplying a number.
Any homocidal maniacs here? Well, if you are, you'll enjoy this:
>kill -9 PID
Guess what I just did. I killed the process! We won't get any final output from this process. Well, that was destructive. Let me see how far this got:
>ls
Well, it unpacked a few files. But not all of them. Let me clean up here:
>rm Subdir/*
"rm" is the command used to delete files. The asterix is a wildcard character which is interpreted as meaning 'all files'. Ok, let's extract a large file:
>yankit x file.shk
Uh oh. I forgot to put the ampersand to put the process in the background! What happens now? Simple.. The magic key is Control-Z.
>^Z
Ok, I got my prompt back. But what's going on? The program is "frozen". It's in the background, but suspended - stopped. From here, I can do several things. I can put it in to the foreground by typing "fg". But we don't want that. Let's put it in to the background using "bg".
>bg
>ps
Yes, it's chugging away in the background. Ok, so while it's doing that. I can do other things on my GS.
Unix enthusiasts can probably relate pretty well to what I'm showing off here. Procyon, the developers of this product, seek to create something just as functional as Unix, and very similar to it. I bet most of you thought that multi-tasking was impossible on the GS.
Brian has hooked up an Apple //c to the serial port of the Apple IIgs. What we're going to do here, is have another machine using the GS while the GS does it's own work as well.
What i'll do here, is launch another shell, which will send all of it's output to the //c, and get all of it's input from the //c as well. This is a funky command line entry here, but it gets the job done.
>gsh <.ttya >.ttya >&.ttya &
Once you go through the manual for GNO, you'll know all these neat tricks, so don't worry. Wow. Look at the //c! We have a prompt on it and everything. Brian, show off some ls' and cd's just to prove to our fine audience that we're not jipping them off with some fake visual effects.
Basically, there's a terminal program running on the //c, which is just acting like it has dialed in to the Apple IIgs as a BBS.
Ok. Now, I'm going to launch the GS<>IRC demo, which was created by a bunch of my buddies - you might have seen it. They have also been involved, as I am, in writing utilities for GNO, and testing it, and so on. I'm launching this on the GS, in the foreground. Keep in mind that the //c is still connected. Actually, I'd better turn down the volume of the GS so you can hear me over the music. Control-OA-ESC, see, all control-panel accessible.
Now. What happens is, you might hear a bit of a slow-down in the music on the GS. I could lie and tell you that I'm just doing some pitch control on it. But the truth is that multi-tasking does take up CPU time and resources, so there will be a slow-down. This is normal on ALL machines, although maybe not as noticeable. Anyway, here goes..
There you go. The demo is running. Now Brian is going to do some fooling around on the //c terminal, but keep in mind, the GS is doing all the work here! "steVIe" this file, Brian.
Ok, this is an editor, almost identical to "vi" on Unix. This is the GS running, and a file stored on the GS being edited!
Quit out of there Brian. Ok, now how about you play around with another ShrinkIt! archive?
Ok, a bit of lag in the music, but we're living.
I'll quit out of this demo, and launch something else on the GS, while Brian still plays on the //c.
Any people here seen soniqTracker? Well, it's a program which plays Amiga MODs on the GS. NoiseTracker by Olivier Goguel was the first to do this on the GS, but Tim Meekins has outdone him in the player section. He's added all the neat effects that are supposed to be there. Anyway, I'll launch that. It's a desktop application, and Brian is still having fun over there..
Here it is. Let me play you one of my more favourite songs... Great stuff. A bit of lag, but it works fine!
Is there anything someone here would like to see me try under GNO? If not, I'll lean a bit away from the machines, and talk theory...
What is GNO good for?
I think the advantages to GNO are VERY obvious. I haven't showed off the terminal program which Jawaid Bazyar created, and has adapted for GNO. It works great, and updates will allow you to download in the background.
You free the system for your work! If you're doing some heavy task, just put it in the background, and free up your machine for other tasks. I know that I've done a bit of ray-tracing, and mandelbrot pictures on my GS, and GNO let's me free up my machine to call out to a BBS and download some files, or read my mail and news. I can clean up my disks,
rename them, work with ShrinkIt archives, and so on! New utilities are being created DAILY for GNO. Not only just useful utilities, but programs and games too! The user-base is growing, and demand for such things is growing as well!
You can share hardware with GNO. Like we have the //c hooked up here, it's using the GS' resources. You can dialout on the GS and download a file to the GS, while controlling all of this from the //c.
The list goes on and on. The uses for it are mainly dictated by yourselves!
Brian handed out a press release that ProCyon issued, it'll include ordering information and so on, for those that want to run out and buy it. It's really a great product, and something people have been saying was impossible to accomplish on the GS.
The Future of GNO
I'll just tell you what's targeted for the future of GNO, and I'll open the floor for questions.
Up and coming products:
UUCP networking. This is my product, and another thing people have said was impossible for the GS to accomplish. UUCP is a method of communicating with large UNIX minicomputers and mainframes.
The GCC compiler. A fellow in Sweden is porting the GNU C compiler to the GS. This is a way better compiler than ORCA's compiler. Oh, on top of that, you can do all your ORCA development under GNO. The utilities for doing this are included with GNO. So you can write your own utilities if you want to.
Apple IIGS programmers will be able to take advantage of GNO for background compiles, etc. ByteWorks ORCA is currently the only compiler that works with GNO but better C compilers are on their way for GNO.
Always more utilities and games and so on are being written for GNO. And old ones are coming up again. Anyone remember the game "Hunt the Wumpus" (I don't I'm way too young to remember these things :) Well, GNO has it.
As far as the shell goes, shell scripts with logic will be completed soon. This is a script language which is very useful for creating quick and dirty little applications. Currently, you can only make script files to the calibre of "batch files" like MS-DOS offers.
More job/process control will be offered.
And currently being thrown around, is an idea to allow the user to "freeze" a process, save all the data to disk, and be able to unfreeze it any time later, and continue the process as if it never stopped. This is something Unix doesn't really offer, but something the GS can!
Permission is hereby granted for non-profit user groups to republish this content. PLEASE CREDIT THE AUTHOR AND THE SOURCE: Applecations, publication of the Apple Users' Group, Sydney, Australia